package simplefactory

type Auto interface {
	Run(name string) string
}

func NewAuto(t string) Auto {
	switch t {
	case "car":
		return &Car{}
	case "train":
		return &Train{}
	}
	return nil
}

type Car struct {
}

func (*Car) Run(name string) string {
	return "car run"
}

type Train struct {
}

func (*Train) Run(name string) string {
	return "train run"
}
